package ilearn.job.ilearnjobgrayversionjava17.buss.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.util.StringUtils;


@Configuration
public class JvmPropertyConfig implements EnvironmentAware {

    @Value("${spring.application.name:BussApplication}")
    private String name;
    @Override
    public void setEnvironment(Environment environment) {
        if (!StringUtils.hasText(System.getProperty("project.name"))){
            System.setProperty("project.name",name);
        }
    }
}
